package cn.wolfcode.mp.service.impl;


import cn.wolfcode.mp.domain.Employee;
import cn.wolfcode.mp.mapper.EmployeeMapper;
import cn.wolfcode.mp.query.EmployeeQuery;
import cn.wolfcode.mp.service.IEmployeeService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements IEmployeeService {

    @Override
    public IPage<Employee> query(EmployeeQuery qo) {
        IPage<Employee> page = new Page<>(qo.getCurrentPage(),qo.getPageSize());
        QueryWrapper<Employee> wrapper = Wrappers.<Employee>query();
        return super.page(page,wrapper);
    }
}
